import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.junit.Test;


/**
 * @Auther: wangxiaodan
 * @Date:2021/3/31 8:45
 * @Description:
 **/
public class Log4JDemo {
    private static final Logger logger = Logger.getLogger(Log4JDemo.class);
    @Test
    public void test(){
        //设置日志级别
        logger.setLevel(Level.WARN);
        //信息
        logger.info("=========log4j demo===========");
        //错误信息
        logger.error("error");
        //调试信息
        logger.debug("debug");
        //警告信息
        logger.warn("warn");
        //追踪信息
        logger.trace("trace");
        //严重信息
        logger.fatal("fatal");
    }
}
